table.EVAL Function

Syntax

Result as A = EVAL(expression as C)

Arguments

expressionCharacter

An Xbasic expression. The expression can reference fields in the table.

Returns

ResultAny Type

Returns the result of the evaluated expression.

Description

Evaluate an expression in the context of the table.

Discussion

The <TBL>.EVAL() method evaluates an expression in the context of a table.

Example

dim tbl as P
tbl = table.open("customer")
? tbl.eval("firstname+lastname")
= "Mederos             Michael            "

' trim the fields:
? tbl.eval("alltrim(firstname)+\" \"+alltrim(lastname)")
= "Mederos Michael"
Fields are not trimmed unless explicitly trimmed in the expression.

See Also